package definite.Guide.Book.JOptionPane;

import java.awt.Font;

import javax.swing.JOptionPane;
import javax.swing.UIManager;

public class Sample {

	public static void main(String[] args) {
		JOptionPane optionPane = new JOptionPane();

		/* 
		JSlider slider = OptionPaneUtils.getSlider(optionPane);
		optionPane.setMessage(new Object[] { "Select a value : ", slider });
		optionPane.setMessageType(JOptionPane.QUESTION_MESSAGE);
		optionPane.setOptionType(JOptionPane.OK_CANCEL_OPTION);
		optionPane.setIcon(new DiamondIcon(Color.RED));
		JDialog dialog = optionPane.createDialog(null, "My Slider");
		dialog.setVisible(true);
		System.out.println(optionPane.getInputValue());
		
		*/

		UIManager.put("OptionPane.cancelButtonText", "Annuler");
		UIManager.put("OptionPane.noButtonText", "Non");
		UIManager.put("OptionPane.okButtonText", "D'accord");
		UIManager.put("OptionPane.yesButtonText", "Oui");
		UIManager.put("OptionPane.messageFont", new Font("San-Serif",
				Font.BOLD, 12));
		/*optionPane.setMessage("I got an icon and a text label");
		optionPane.setMessageType(JOptionPane.INFORMATION_MESSAGE);
		Icon icon = new DiamondIcon(Color.BLUE);
		JButton jButton = OptionPaneUtils.getButton(optionPane, "OK", icon);
		optionPane.setOptions(new Object[] { jButton });
		optionPane.setForeground(Color.GREEN);
		optionPane.setBackground(Color.YELLOW);
		JDialog dialog = optionPane.createDialog(null, "Icon/Text Button");
		dialog.setOpacity(1);
		dialog.setVisible(true);*/

		int result =
			JOptionPane.showConfirmDialog(null,
					"Est-ce que vous avez 18 ans ou plus?",
					"Choisisez une option", JOptionPane.YES_NO_CANCEL_OPTION);

	}

}
